<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>去保养-保养直播</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="keywords" content="汽车保养,汽车配件,汽车维修,养车无忧,养车,4S店品质,氦修驿站,丰田保养" />
    <meta name="description" content="100%正品配件,4S店一半价格,先行赔付,闪电送达!线上购买配件,线下提供安装.上万用户的最佳选择!去掉中间环节,直接从源头采购配件!" />
    <link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/css/base.css">
    <link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/mobile/css/master.css">
    <style>
    #live .loading{ position:absolute;top:0px;left:0px;text-align:center;line-height:100px;width:100%;display:none;z-index:1;color:#fff;height:100%;background:#000;font-size:14px;}
    </style>
</head>

<body style="height:auto;">
    <eq name="_SESSION['Server']" value="wx">
        <header>
            <a href="tel:4006730088" class="tel iconfont">&#xe60c;</a>
            <a href="javascript:void(0)" class="menu iconfont" onclick="home.showMenu()">&#xe602;</a>
            <img src="{:C('WEB_URL')}Public/mobile/images/logo.png" id="logo">
        </header>
        
    <else />
        <header class="tcenter fs14">
            <a href="tel:4006730088" class="tel iconfont">&#xe610;</a>
            <a href="javascript:window.history.go(-1)" class="iconfont fleft">&#xe612;</a>
            我的保养直播
        </header>
    </eq>
    <include file="Public/mobileHome" />
    <div class="main" id="live">
        <div class="videoMain">
            <video src="http://vshare.ys7.com/hcnp/502682816_1_2_1_0_183.136.184.7_6500.m3u8?04d57edd-7e18-4bfa-94df-fabe80bf9fc9" controls="controls" webkit-playsinline preload="auto" id="video"></video>
            <img src="{:C('WEB_URL')}Public/mobile/images/liveLogo.png" style="position:absolute;top:12px;left:10px;width:70px">
            <div class="loading">
                <p>正在加载中，请稍候...</p>
            </div>
        </div>
        
        <empty name="_SESSION['user']">
            <style>
                #login{padding-top:0px;}
                #login h3{font-weight:500;height:42px;line-height:42px;background:#f0f0f0;padding:0 20px;border-bottom:1px solid #ddd;font-size:16px;}
                #login ul{padding-top:0px;}
            </style>
            <div id="login">
                <h3>登录观看爱车检测全过程</h3>
                <ul>
                    <li>
                        <input type="tel" name="phone" placeholder="请输入您的手机号" />
                    </li>
                    <li>
                        <input type="password" name="code" placeholder="6位短信验证码" />
                        <a href="javascript:void(0)" class="getCode" id="J_getCode">获取验证码</a>
                    </li>
                </ul>
                <a href="javascript:void(0)" class="iconfont" id="btnSubmit">提交</a>
            </div>
            <script>
                ;
                (function(){
                    $("#J_getCode").on("click",function(){
                        var _t = $(this);
                        if (_t.hasClass("getCodeGray")) {
                            return false;
                        }
                        var phone=$("input[name='phone']").val();
                        if(!/^(13|15|18|14|17)[0-9]{9}$/.test(phone)){
                            showMsgTip("您的手机号有误");
                            return false;
                        }
                        _t.addClass("getCodeGray");
                        $.ajax({
                            url:"{:C('WEB_URL')}mobile/getCode.html",
                            type:"POST",
                            data:{"username":phone},
                            datType:"JSON",
                            success:function(res){
                                if(res.status==1){
                                    setCookie("codeMin",60);
                                    countDown(_t);
                                }else{
                                    _t.removeClass("getCodeGray");
                                    alert(res['info']);
                                }
                            }
                        })
                    })

                    $("#btnSubmit").on("click",function(){
                        var _t = $(this);
                        var phone=$("input[name='phone']").val(),
                            code=$("input[name='code']").val().replace(/\D/g,"");
                        if(!/^(13|15|18|14|17)[0-9]{9}$/.test(phone)){
                            showMsgTip("您的手机号有误");
                            return false;
                        }else if(code.length!=6){
                            showMsgTip("短信验证码有误");
                            return false;
                        }

                        $.ajax({
                            url:"{:C('WEB_URL')}mobile/valCode.html",
                            type:"POST",
                            data:{"phone":phone,"code":code},
                            datType:"JSON",
                            success:function(res){
                                if(res.status==1){
                                    window.location.href="{:C('WEB_URL')}mobile/live/";
                                }else{
                                    showMsgTip(res.info);
                                    return false;
                                }
                            }
                        })
                    })

                    getCodeStatus();
                    function getCodeStatus(){
                        var min=getCookie("codeMin");
                        if(min>0){
                            $("#J_getCode").addClass("getCodeGray");
                            countDown($("#J_getCode"));
                        }
                    }

                    //验证码倒计时
                    function countDown(_t) {
                        min=getCookie("codeMin")*1-1;
                        if (min == 0) {
                            _t.html("获取验证码");
                            _t.removeClass("getCodeGray");
                        } else {
                            _t.html(min+"秒后重新获取");
                            setCookie("codeMin",min--);
                            setTimeout(function() {
                                countDown(_t);
                            },1000)
                        }
                    }

                    $("#msgTip").on("click",function(){
                        $("#msgTip").hide();
                    })
                })()
            </script>

        <else />
            <div class="error">
                <i>&#xe619;</i>
                <p class="p1">您当前没有正在进行中的保养</p>
                <p class="p2"><a href="/">立即下单</a>,体验一次互联网式的保养</p>
            </div>
        </empty>

    </div>

</body>
</html>